by a whisker

Translations
на волосок
He won the race by a whisker.
Он выиграл гонку на волосок.
Definitions
By a whisker refers to a very small margin or difference, often used to describe a situation where something was narrowly achieved or avoided.